﻿/*
 * Copyright (C) 2014 Cypress Data Defense, LLC    
 * oss@cypressdefense.com
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
*/

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CypressDefense.Security.Shim.Configuration.Base
{
    public class LocationElement : ConfigurationElement
    {
        //REGEX forces relative path or dir: "path", "path/file.aspx", "file.aspx" are all valid.
        [ConfigurationProperty("path", IsKey = true, DefaultValue = "default.aspx")]
        [RegexStringValidator(@"^([-a-zA-Z0-9+&@#%=~_|!:,.;]+)(/[-a-zA-Z0-9+&@#%=~_|!:,.;]+)*$")]
        public string Path
        {
            get { return (string)base["path"]; }
            set { base["path"] = value; }
        }

        public string RelativePath { get; set; }
    }
}
